//
//  YFLmainTableViewCell.m
//  Music
//
//  Created by dllo on 16/6/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YFLmainTableViewCell.h"

@implementation YFLmainTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.photoimageView =[[UIImageView alloc]init];
        //self.photoimageView.backgroundColor =[UIColor greenColor];
        self.photoimageView.layer.cornerRadius = 40;
        self.photoimageView.layer.masksToBounds = YES;
        [self.contentView addSubview:_photoimageView];
       
        
        
        self.titleLabel =[[UILabel alloc]init];
        //self.titleLabel.backgroundColor =[UIColor purpleColor];
        [self.contentView addSubview:_titleLabel];
        
        
        
    }
    return self;
}


-(void)layoutSubviews
{
    
    [super layoutSubviews];
    
    self.photoimageView.frame = CGRectMake(5, 5, 80, 80);
    
    
    self.titleLabel.frame = CGRectMake(self.photoimageView.frame.size.width+15+self.photoimageView.frame.origin.x, (self.photoimageView.frame.size.height-20)/2-5, Screenwidth, self.photoimageView.frame.size.height/2);
    
    
    
}

-(void)setYFLmodel:(NianFeilongModel *)YFLmodel
{
    if (_YFLmodel != YFLmodel) {
        _YFLmodel = YFLmodel;
    }
    
    [self.photoimageView sd_setImageWithURL:[NSURL URLWithString:YFLmodel.picUrl] placeholderImage:[UIImage imageNamed:@"占.jpg"]];
    self.titleLabel.text = YFLmodel.name;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
